/**
 * 将token 存储到 redis中
 */
import Cookie from 'js-cookie';

const key = 'X-Authorization';

//设置token
export const setToken = (value) => {
  Cookie.set(key, value);
};

//获取token
export const getToken = () => {
  return Cookie.get(key);
};

//删除token
export const delToken = () => {
  return Cookie.remove(key);
};

/**
 * 检查认证信息
 * @param authType
 * @returns {boolean}
 */
export const checkAuthorization = () => {
  if (getToken) {
    return true;
  }
  return false;
};
